package com.cc.secondKill.service.impl;

import com.cc.secondKill.dao.OrderMapper;
import com.cc.secondKill.pojo.Order;
import com.cc.secondKill.service.IOrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service("orderService")
public class OrderService implements IOrderService {

    @Autowired
    private OrderMapper orderMapper;

    public Order getOrderByGoodsIdAndPhone(String phone,Integer goodsId){
        if (phone == null || goodsId == null){
            return null;
        }
        Order order = this.orderMapper.getOrderByGoodsIdAndPhone(goodsId, phone);
        return order;
    }

}
